﻿using System.Drawing;
using System.IO;

namespace WallpaperSharing.AppLibrary.Extensions
{
    public static class ByteArrayExtensions
    {
        public static Image ToImage(this byte[] data)
        {
            Image result;
            using (var stream = new MemoryStream(data))
            {
                result = Image.FromStream(stream);
            }

            return result;
        }
    }
}
